{% extends 'base.html' %}
{% block tips %}
    <h3>出版社管理</h3>
{% endblock tips %}
{% block content %}
    <div class="col-md-offset-1 col-md-10">
        <a href="{% url 'book:press_add' %}">
            <button type="button" class="btn btn-primary">添加出版社</button>
        </a>
        <p>
        <p>
        <h3 class="text-center">出版社列表</h3></p>
        <table class="table table-bordered table-striped table-hover">
            <!-- On rows -->
            <thead>
            <tr>
                <td class="success">编号</td>
                <td class="info">出版社名</td>
                <td class="success">所在城市</td>
                <td class="info">出版书数量</td>
                <td class="success">操作</td>
            </tr>
            </thead>
            <tbody>
            {% for press in press_list %}
                <tr>
                    <td>{{ forloop.counter }}</td>
                    <td>{{ press.name }}</td>
                    <td>{{ press.city }}
                    </td>
                    <td>{{ press.book_count }}</td>
                    <td>
                        <button type="button" class="btn btn-warning"><a
                                href="{% url 'book:press_edit' press.id %}">编辑</a>
                        </button>
                        <button type="button" class="btn btn-danger"><a
                                href="{% url 'book:press_del' press.id %}">删除</a>
                        </button>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
{% endblock content %}